<?php
	//头部
	$firstCode = "";
	$secondCode = "";
	if ($siteData['temp']==1) {
		if (!empty($firstCategory)) {
			foreach ($firstCategory as $key=>$value){
				$firstCode .= '<li class="navLi"><a href="'.base_url('depsiteList').'/?site='.$siteData['site_url'].'&id='.$value['classid'].'">'.$value['category_name'].'</a></li>';
			}
			if (!empty($secondCategory)) {
				for($i = 0; $i < count($firstCategory); $i++){
					$secondCode .= '<div class="subNavItem"'.'>';
					for($j = 0; $j<count($secondCategory); $j++){
						if($secondCategory[$j]['parentid']==$firstCategory[$i]['classid']){
							$secondCode .= '<a href="'.base_url('depsiteList').'/?site='.$siteData['site_url'].'&id='.$secondCategory[$j]['classid'].'">'.$secondCategory[$j]['category_name'].'</a>&nbsp;';
						}
					}
					$secondCode .= '</div>' ;
				}
			}
		}
		$firstCode .='<li class="navLi"><a href="'.base_url('levelword').'/?site='.$siteData['site_url'].'">留言</a></li>';
	}else{
		foreach ($firstCategory as $key=>$value){
			$firstCode.= '<li><a id="a1"  href="'.base_url("depsiteList").'/?site='.$siteData['site_url'].'&id='.$value['classid'].'"><span class="arrow">'.$value['category_name'].'</span></a><ul>';
	       	foreach ($secondCategory as $k=>$v){
	       		if ($v['parentid']==$value['classid']) {
	       			$firstCode .='<li><a href="'.base_url("depsiteList").'/?site='.$siteData['site_url'].'&id='.$v['classid'].'">'.$v['category_name'].'</a></li>';
	       		}
	       	}
			$firstCode.= '</ul></li>';
		}
		$firstCode .='<li style="border-top-right-radius:10px;"><a id="a1" href="'.base_url('levelword').'/?site='.$siteData['site_url'].'"><span class="arrow">留言</span></a></li>';
	}
	$indexCode = base_url('depsites/?site='.$siteData['site_url']);
	$searchCode = base_url('search/?site='.$siteData['site_url']);
	$arr_top = array(
			"@@搜索@@" => $searchCode,
//			"@@站点@@" => $siteData['classid'],
			"@@首页链接@@" => $indexCode,
			"@@网站名称@@" =>$siteData['site_name'],
			"@@Logo@@" => $siteData['site_logo'],
			"@@Site_index@@" => base_url('depsites')."/?site=".$siteData['site_url'],
			"@@一级栏目@@" => $firstCode,
			"@@二级栏目@@" => $secondCode
			);
	echo strtr($siteTemp['common_top'],$arr_top);
?>